import { defHttp } from "@/utils/http";

// ERP 药品仓库分类 API
export const dwhTypeApi = {
	// 获得药品仓库分类分页
	dwhTypeList: async (params: any) => {
		return await defHttp.get({ url: `/whs/dwh-type/page`, params });
	},
	// 获得产品分类精简列表
	dwhTypeSimpleList: async (params: any) => {
		return await defHttp.get({
			url: `/whs/dwh-type/simple-list`,
			params
		});
	},
	// 获得来源列表
	catFundingSimpleList: async (params: any) => {
		return await defHttp.get({
			url: `/whs/cat-funding/simple-list`,
			params
		});
	},
	// 新增药品仓库分类
	dwhTypeCreate: async (data: any) => {
		return await defHttp.post({ url: `/whs/dwh-type/create`, data });
	},

	// 修改药品仓库分类
	dwhTypeUpdate: async (data: any) => {
		return await defHttp.put({ url: `/whs/dwh-type/update`, data });
	},

	// 删除药品仓库分类
	dwhTypeDelete: async (id: number) => {
		return await defHttp.delete({ url: `/whs/dwh-type/delete?id=` + id });
	}
};
